package cn.occgmat.controller;

import cn.occgmat.entity.RbsystemStation;
import cn.occgmat.entity.RbsystemTimetable;
import cn.occgmat.entity.RbsystemUser;
import cn.occgmat.service.RbsystemStationService;
import cn.occgmat.util.BaseResponse;
import cn.occgmat.util.StatusCode;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * 车站信息表(RbsystemStation)表控制层
 *
 * @author shimmer
 * @since 2021-03-27 15:36:45
 */
@RestController
@RequestMapping("rbsystemStation")
public class RbsystemStationController {
    /**
     * 服务对象
     */
    @Resource
    private RbsystemStationService rbsystemStationService;

    /**
     * 分页查询车站信息
     *
     * @param page  当前页数
     * @param limit 每页数
     * @return json数据
     */
    @GetMapping(value = "selectPage")
    public BaseResponse<RbsystemStation> selectPage(int page, int limit) {
        int startPage = (page - 1) * limit;
        BaseResponse<RbsystemStation> baseResponse = new BaseResponse<>(StatusCode.Success);
        baseResponse.setData(rbsystemStationService.queryAllByLimit(startPage, limit));
        baseResponse.setCount(rbsystemStationService.getCount());
        return baseResponse;
    }

}
